/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package technotheist.data;

import technotheist.data.wrap.BSubBuffer;

/**
 *
 * @author Mitch
 * @param <T>
 */
public abstract class BBuffer<T> {
    
    public static interface Mappable {
	public int ordinal();
    }

    public abstract Class<?> primType();

    public abstract int size();

    private int position = 0;
    public T s() {
	T s = s(position++);
	position = position%size();
	return s;
    }
    
    public void rewind() {
	position = 0;
    }
    
    
    public abstract T s(int index);

    public abstract void s(int index, T v);

    public BSubBuffer<T> createSubBuffer(int size, int offset) {
	return new BSubBuffer<>(this, size, offset);
    }
}
